let order=require('../model/order.js')

async function createOrder(data){
   
    let res=await order.create(data)
    return res
}

async function findOrder(user_id){
   let res=await order.findAll({where:{
         user_id
   }})
   return res
}

async function update(obj){
   let res=await order.update({status:obj.status},{where:{
       order_number:obj.order_number
   }})
   return res
}
module.exports={
    createOrder,
    findOrder,
    update
}